{% extends 'base.html' %}
{% import 'bootstrap/wtf.html' as wtf %}
{% import '_macros.html' as macros %}
{% import '_my_wtf_macros.html' as my_wtf_macros %}

{% block head %}
  {{ super() }}
  <style type="text/css">
      textarea {width:100% !important;}
  </style>
{% endblock %}

{% block title %}万屏时代--首页基本信息编辑({{ enterprise_homepage.enterprise_name }}){% endblock %}

{% block panel_heading %}
    万屏时代--首页基本信息编辑({{ enterprise_homepage.enterprise_name }})
{% endblock %}

{% block panel_body %}
    <form class="form form-inline form-group-sm"
          action="{{ url_for('enterprise_bp.enterprise_homepage_edit', enterprise_id = enterprise_id) }}" method="post"
          role="form">
        <div class="well well-sm">TDK相关信息</div>

        {{ my_wtf_macros.form_field(form.hostname, div_col=6, label_col=2, field_col=10) }}
        {{ my_wtf_macros.form_field(form.title, div_col=6, label_col=2, field_col=10) }}
        {{ my_wtf_macros.form_field(form.description, div_col=12, label_col=1, field_col=11) }}
        {{ my_wtf_macros.form_field(form.keywords, div_col=12, label_col=1, field_col=11) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="well well-sm">色号信息</div>
        {{ my_wtf_macros.form_field(form.base_color_num, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.first_screen_color_num, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.security_color_num, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.product_color_num, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.partner_color_num, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.about_us_color_num, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.scale_color_num, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="well well-sm">页眉、页脚logo (建议图片不超过50KB)</div>
        页眉logo:<input type="file" class="qiniu_upload" accept=".jpg,.png" data-img-key="header_logo">
        {% if enterprise_homepage.header_logo %}
            <img src="{{ enterprise_homepage.header_logo_url }}" width="300px" height="300px">
            <input type="hidden" name="header_logo" value="{{ enterprise_homepage.header_logo }}">
        {% endif %}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        页脚logo:<input type="file" class="qiniu_upload" accept=".jpg,.png" data-img-key="footer_logo">
        {% if enterprise_homepage.footer_logo %}
            <img src="{{ enterprise_homepage.footer_logo_url }}" width="300px" height="300px">
            <input type="hidden" name="footer_logo" value="{{ enterprise_homepage.footer_logo }}">
        {% endif %}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="well well-sm">客服IM信息</div>
        {{ my_wtf_macros.form_field(form.agent_name, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        客服头像:<input type="file" class="qiniu_upload" accept=".jpg,.png" data-img-key="agent_avatar">
        {% if enterprise_homepage.agent_avatar %}
            <img src="{{ enterprise_homepage.agent_avatar_url }}" width="300px" height="300px">
            <input type="hidden" name="agent_avatar" value="{{ enterprise_homepage.agent_avatar }}">
        {% endif %}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="well well-sm">首屏信息 (建议图片不超过300KB)</div>
        首屏背景图:<input type="file" class="qiniu_upload" accept=".jpg,.png" data-img-key="first_screen_background">
        {% if enterprise_homepage.first_screen_background %}
            <img src="{{ enterprise_homepage.first_screen_background_url }}" width="300px" height="300px">
            <input type="hidden" name="first_screen_background" value="{{ enterprise_homepage.first_screen_background }}">
        {% endif %}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <br/>
        {{ my_wtf_macros.form_field(form.first_screen_title, div_col=12, label_col=2, field_col=10) }}
        {{ my_wtf_macros.form_field(form.first_screen_subtitle, div_col=12, label_col=2, field_col=10) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="well well-sm">虚拟号(请找管理员索取) (建议图片不超过50KB)</div>
        {{ my_wtf_macros.form_field(form.virtual_number, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        虚拟号图片:<input type="file" class="qiniu_upload" accept=".jpg,.png" data-img-key="virtual_number_img">
        {% if enterprise_homepage.virtual_number_img %}
            <img src="{{ enterprise_homepage.virtual_number_img_url }}" width="300px" height="300px">
            <input type="hidden" name="virtual_number_img" value="{{ enterprise_homepage.virtual_number_img }}">
        {% endif %}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="well well-sm">
            项目案例
        </div>
        {{ my_wtf_macros.form_field(form.project_subtitle, div_col=12, label_col=2, field_col=10) }}

        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>

        <div class="well well-sm">
            保障体系
        </div>
        {{ my_wtf_macros.form_field(form.security_subtitle, div_col=12, label_col=2, field_col=10) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>

        <div class="well well-sm">
            产品展示
        </div>
        {{ my_wtf_macros.form_field(form.product_subtitle, div_col=12, label_col=2, field_col=10) }}

        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>

        <div class="well well-sm">合作伙伴信息 (建议图片不超过300KB)</div>
        {{ my_wtf_macros.form_field(form.partner_subtitle, div_col=12, label_col=2, field_col=10) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        合作伙伴图片:<input type="file" class="qiniu_upload" accept=".jpg,.png" data-img-key="partner_img">
        {% if enterprise_homepage.partner_img %}
            <img src="{{ enterprise_homepage.partner_img_url }}" width="300px" height="300px">
            <input type="hidden" name="partner_img" value="{{ enterprise_homepage.partner_img }}">
        {% endif %}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <br/>
        <div class="well well-sm">了解我们 (建议图片不超过50KB)</div>
        法人头像:<input type="file" class="qiniu_upload" accept=".jpg,.png" data-img-key="legal_person_avatar">
        {% if enterprise_homepage.legal_person_avatar %}
            <img src="{{ enterprise_homepage.legal_person_avatar_url }}" width="300px" height="300px">
            <input type="hidden" name="legal_person_avatar" value="{{ enterprise_homepage.legal_person_avatar }}">
        {% endif %}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <br/>
        {{ my_wtf_macros.form_field(form.about_us_subtitle, div_col=12, label_col=2, field_col=10) }}
        {{ my_wtf_macros.form_field(form.legal_person_name, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.registered_capital, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.registered_date, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.staff_size, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>

        <div class="well well-sm">
            网站备案
        </div>
        {{ my_wtf_macros.form_field(form.safety_record, div_col=6, label_col=3, field_col=9) }}
        {{ my_wtf_macros.form_field(form.record_number, div_col=6, label_col=3, field_col=9) }}

        <div class="form-group col-xs-12">
            <button type="submit" name="submit" class="btn btn-success pull-right">保存</button>
        </div>
    </form>
{% endblock %}
{% block scripts %}
{{ super() }}
    <script src="{{url_for('static', filename='opc.js')}}"></script>
{% endblock %}
